public class Opdracht3_1 {

  public Opdracht3_1(){
    System.out.println("Opdracht 3.1");
    double lol = 0;
    double deA = Main.vraagDouble("A (double)");
    double deB = Main.vraagDouble("B (double)");
    double deC = Main.vraagDouble("C (double)");
    System.out.println("abc("+deA+","+deB+","+deC+") = " + abc(deA,deB,deC,true) + " | " + abc(deA,deB,deC,false));
  }

  public static double abc(double a, double b, double c, boolean plus) {
    //ax²+bx+c=0
    double ans = 0;
    //Plus of Min
    if (plus) {
      ans = (-b + Math.pow(Math.pow(b, 2) - (4 * a * c),0.5)) / (2 * a);
    } else {
      ans = (-b - Math.pow(Math.pow(b, 2) - (4 * a * c),0.5)) / (2 * a);
    }
    return ans;
  }

  public static void main(String[] args){
    new Opdracht3_1();
  }
}
